<template>
  <div id="app" >
    <div   v-loading="loadingFn.loading"
           :element-loading-text="loadingFn.text"
           element-loading-spinner="el-icon-loading">

    <router-view/>
    </div>
  </div>
</template>
<style scoped>
  .card{ margin-bottom: 12px;line-height: 0rem;}
  .ment{ position:fixed; bottom: 10%;right: 20px;z-index: 11111}
  .imgBox{width: .72rem;height: .72rem;min-width: 72px;min-height: 72px; border-radius:50%;background-color: #5ea3d1; cursor: pointer;position: relative}
  .imgBox .alert{position: absolute;right: 80px;background-color: #FFF; padding: 15px ; color: #000; border: 1px solid #e1e1e1;top: .1rem ;width: 200px;font-size: .24rem;font-weight: bold}
  .imgBox div.alert{ padding: 15px;width: 200px}
  .imgdeift{padding: 15px }
  .imgBox div.alert img{margin: 0px;width: 200px}
  .imgBox img{width: 100%; margin: auto;}
  .imgBox p{line-height: .2rem;font-size: .12rem;color: #fff }
  .text{padding-top: .1rem}
  @media only screen and (min-width: 1200px){



  }
  @media only screen and (min-width: 1400px){


  }
  @media only screen and (min-width: 1920px){

  }
</style>
<script>
  import Public from '@/vuex/public'
  import {mapState, mapActions} from 'vuex'
  import imgdeift from '../static/img/wx.jpg'
  import icon_zhiding from '../static/img/icon_zhiding.png'
  import icon_zxkf from '../static/img/icon_zxkf.png'
  import icon_wechat from '../static/img/icon_wechat.png'

  export default {
    name: 'app',
    beforeCreate() {

    },
    created () {
      this.$store.commit('httpTo', this.$http);
      this.getjson()
    },
    data(){
      return{
        loading2:false,
        show:false,
        imgdeift:imgdeift,
        show1:false,
        show2:false,
        icon_zhiding:icon_zhiding,
        icon_zxkf:icon_zxkf,
        icon_wechat:icon_wechat,
        t:''
      }
    },
    methods:{
      top(){
        Public.publicLo.scroll_To(0)
      },
      getjson(){
        this.$http.get('/static/stationCode.json').then(function (res) {

                this.$store.commit('stationTo', res.body);
        })
      },
      showFn(a){
        if(a==1){
          this.show2 = false
          this.show1 = !this.show1
        }
        if(a==2){
          this.show1 = false
          this.show2 = !this.show2
        }
      },
      usFn(){

        window.open('http://v1.live800.com/live800/chatClient/chatbox.jsp?companyID=952262&configID=44360&jid=4586145511')
      },
      openError (text) {
        this.$message.error(text)
      },
    },
    mounted(){

    },
    computed: {
      // 联系我们
      languageData: function () {
        var parm = this.language
        if (parm) {
          if (parm.check == 'Chinese') {
            parm = parm.Chinese
          }
          if (parm.check == 'English') {
            parm = parm.English
//            this.formConfig.labelWidth = '200px'
//            dom.style = 'width:620px'
          }
          // 替换 其他交互数据
//          this.updateDate(parm)
        }
        return parm
      },
      loadingFn: function () {
        var parm = this.loading;
        var _this = this;
          if(parm.loading == true){
            this.t  = setTimeout(function () {
              parm.loading = false;
              this.$store.commit('stationTo', res.body);
              _this.openError('链接超时')
              this.$store.commit('commitLoading', {loading:false,text:'请稍后!'})
            },20000)
          }else {
            if(this.t){
              clearTimeout(this.t)
            }
          }

        return parm
      },
      ...mapState([
        'addOderData',
        'language',
        'userData',
        'loading'
      ])
    },
  }
</script>

<style>
  #app {
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2c3e50;
    height: 100%;
  }
</style>
